package router

import (
	"parking-lot-go-dingding/controller"
	"parking-lot-go-dingding/controller/member"
	"parking-lot-go-dingding/controller/news"
	"parking-lot-go-dingding/controller/park"
	"parking-lot-go-dingding/controller/push"
	"parking-lot-go-dingding/controller/subscribe"
	"parking-lot-go-dingding/controller/user"

	"github.com/gin-gonic/gin"
)

func StartRoutes(r *gin.Engine) {
	//订阅相关
	r.POST("subscribe", subscribe.Subscribe)

	//首页
	r.POST("home", controller.Home)

	//获取用户信息
	r.POST("get_user_info", user.GetUserInfo)

	//获取用户信息
	r.POST("seeting", controller.Seeting)

	//消费记录
	r.POST("consumption", controller.Consumption)

	//余额变动记录
	r.POST("balance", controller.Balance)

	//新闻
	newsGroup := r.Group("news")
	{
		newsGroup.POST("", news.List)
		newsGroup.POST("/detail", news.Detail)
	}

	//停车场
	parkGroup := r.Group("park")
	{
		parkGroup.POST("", park.List)
		parkGroup.POST("/detail", park.Detail)
	}

	//会员
	memberGroup := r.Group("member")
	{
		memberGroup.POST("", member.List)
		memberGroup.POST("/detail", member.Detail)
		memberGroup.POST("/delete", member.Delete)
		memberGroup.POST("/deletes", member.Deletes)
		memberGroup.POST("/disable", member.Disable)
		memberGroup.POST("/undisable", member.UnDisable)

		//临时会员
		memberGroup.POST("/temporary_add", member.TemporaryAdd)
		memberGroup.POST("/temporary_update", member.TemporaryUpdate)

		//钉钉会员列表
		memberGroup.GET("/ding_talk_user", member.DingTalkUser)

		//正常会员
		memberGroup.POST("/normal_add", member.NormalAdd)
		memberGroup.POST("/normal_update", member.NormalUpdate)
	}

	//推送
	pushGroup := r.Group("push")
	{
		pushGroup.POST("entry", push.Entry)
		pushGroup.POST("out", push.Out)
	}
}
